Public Class frm_PolizaSeguroVida
    Public dtt_Data As DataTable
    Private Sub frm_PolizaSeguroVida_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim dtt_TCese As DataTable
        Dim dtt_Etiquetas As DataTable
        Dim str_Vendors As String
        Dim i As Integer

        str_Vendors = "("

        If dtt_Data.Rows.Count = 1 Then
            str_Vendors = str_Vendors & "'" & dtt_Data.Rows(i)("VENDOR").ToString & "'"
        Else
            For i = 0 To dtt_Data.Rows.Count - 1
                str_Vendors = str_Vendors & "'" & dtt_Data.Rows(i)("VENDOR").ToString
                If i = dtt_Data.Rows.Count - 1 Then
                    str_Vendors = str_Vendors & "'"
                Else
                    str_Vendors = str_Vendors & "',"
                End If
            Next
        End If

        str_Vendors = str_Vendors & ")"
        'dtt_TCese = TraerDatosReporte("0301647")
        dtt_TCese = TraerDatosReporte(str_Vendors)
        dtt_Etiquetas = TraerEtiquetasReporte("PSEG")


        dtt_TCese.Columns.Add("CAMPO1")
        dtt_TCese.Columns.Add("CAMPO2")
        dtt_TCese.Columns.Add("CAMPO3")
        dtt_TCese.Columns.Add("CAMPO4")
        dtt_TCese.Columns.Add("CAMPO5")
        dtt_TCese.Columns.Add("CAMPO6")
        dtt_TCese.Columns.Add("CAMPO7")
        dtt_TCese.Columns.Add("CAMPO8")
        dtt_TCese.Columns.Add("CAMPO9")
        dtt_TCese.Columns.Add("CAMPO10")
        dtt_TCese.Columns.Add("CAMPO11")
        dtt_TCese.Columns.Add("CAMPO12")


        For i = 0 To dtt_TCese.Rows.Count - 1
            dtt_TCese.Rows(i)("CAMPO1") = dtt_Etiquetas.Rows(0)("CAMPO1")
            dtt_TCese.Rows(i)("CAMPO2") = dtt_Etiquetas.Rows(0)("CAMPO2")
            dtt_TCese.Rows(i)("CAMPO3") = dtt_Etiquetas.Rows(0)("CAMPO3")
            dtt_TCese.Rows(i)("CAMPO4") = dtt_Etiquetas.Rows(0)("CAMPO4")
            dtt_TCese.Rows(i)("CAMPO5") = dtt_Etiquetas.Rows(0)("CAMPO5")
            dtt_TCese.Rows(i)("CAMPO6") = dtt_Etiquetas.Rows(0)("CAMPO6")
            dtt_TCese.Rows(i)("CAMPO7") = dtt_Etiquetas.Rows(0)("CAMPO7")
            dtt_TCese.Rows(i)("CAMPO8") = dtt_Etiquetas.Rows(0)("CAMPO8")
            dtt_TCese.Rows(i)("CAMPO9") = dtt_Etiquetas.Rows(0)("CAMPO9")
            dtt_TCese.Rows(i)("CAMPO10") = dtt_Etiquetas.Rows(0)("CAMPO10")
            dtt_TCese.Rows(i)("CAMPO11") = dtt_Etiquetas.Rows(0)("CAMPO11")

            dtt_TCese.Rows(i)("CAMPO12") = dtt_Etiquetas.Rows(0)("CAMPO12") & " " & Format(Now(), "dd") & " de " & _
                                                    Format(Now(), "MMMM") & " de " & _
                                                    Format(Now(), "yyyy")

            dtt_TCese.AcceptChanges()
        Next

        Dim myReport As New crp_PolizaSeguroVida
        myReport.SetDataSource(dtt_TCese)
        Me.crv_PSeguro.ReportSource = myReport

        Me.WindowState = FormWindowState.Maximized

    End Sub

End Class